<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:messages id="msgs" showDetail="false"/>
            <p:tabView dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="存款余额数据">
                    <div id="qrytable">
                        <h:form id="form">
                            <h:panelGrid columns="2" cellspacing="2">
                                <h:outputLabel value="报表日期:" style="font-weight: bold;" for="startdate"/>
                                <p:inputText id="startdate" required="true" requiredMessage="日期不能为空。"
                                             value="#{depositbalAction.startdate}"
                                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                            </h:panelGrid>
                            <p:menubar style="margin-top:20px">
                                <p:menuitem type="push" value="获取存款余额数据" icon="ui-icon ui-icon-gear"
                                            action="#{depositbalAction.onExtractData}" update="msgs, pdt"/>
                                <p:menuitem type="push" value="导出存款余额上报文件" icon="ui-icon ui-icon-gear"
                                            action="#{depositbalAction.onExportTxt}" ajax="false"/>
                            </p:menubar>

                            <p:ajaxStatus style="height:18px;text-align:center">
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                                </f:facet>
                                <f:facet name="complete">
                                    <h:outputText value=""/>
                                </f:facet>
                            </p:ajaxStatus>
                            <p:dataTable id="pdt" dynamic="true" style="width:100%;"
                                         value="#{depositbalAction.detlList}" var="record"
                                         selection="#{depositbalAction.selectedRecords}"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} 【总笔数:#{depositbalAction.totalcount}】"
                                         paginator="true" rows="15" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="数据记录为空...">
                                <p:column selectionMode="multiple"/>

                                <p:column headerText="金融机构编码" style="text-align:center">
                                    <h:outputText value="#{record.bankcode}"/>
                                </p:column>
                                <p:column headerText="存款主体名称" style="text-align: center">
                                    <h:outputText value="#{record.clientname}"/>
                                </p:column>
                                <p:column headerText="存款帐户代码" style="text-align: center">
                                    <h:outputText value="#{record.depositaccountno}"/>
                                </p:column>
                                <p:column headerText="存款帐户类型" style="text-align: center">
                                    <h:outputText value="#{record.depositaccounttypecode}"/>
                                </p:column>
                                <p:column headerText="存款协议代码" style="text-align: center">
                                    <h:outputText value="#{record.depositagreementno}"/>
                                </p:column>
                                <p:column headerText="产品类别" style="text-align: center">
                                    <h:outputText value="#{record.productstypecode}"/>
                                </p:column>
                                <p:column headerText="币种" style="text-align: center">
                                    <h:outputText value="#{record.currencycode}"/>
                                </p:column>
                                <p:column headerText="余额">
                                    <h:outputText value="#{record.balamt}" style="float: right">
                                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="利率是否固定" style="text-align: center">
                                    <h:outputText value="#{record.rateflexibletypecode}"/>
                                </p:column>
                                <p:column headerText="利率水平" style="text-align: center">
                                    <h:outputText value="#{record.intrate}" style="float: right">
                                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="报表日期" style="text-align: center">
                                    <h:outputText value="#{record.reportdate}"/>
                                </p:column>
                            </p:dataTable>
                        </h:form>
                    </div>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>